package cn.wolfcode.wolf2w.util;

import cn.wolfcode.wolf2w.exception.LogicException;
import org.springframework.util.StringUtils;

/**
 * 参数断言工具类
 */
public  abstract class AssertUtil {
    //判断字符串是否为空
    public static void haslength(String str,String msg){
        if(!StringUtils.hasLength(str)){
            throw new LogicException(msg);
        }
    }
    //检验两次密码是否相等
    public static void isEquals(String v1,String v2,String msg){
        if(v1==null||v2==null){
            throw new LogicException(msg);
        }
        if(!v1.equals(v2)){
            throw new LogicException(msg);
        }
    }

}
